package com.jp.knowledge.activity;

import android.support.design.widget.TabLayout;
import android.view.View;

import com.jp.knowledge.fragment.SearchAttentionFragment;

/**
 * Created by 528787067@qq.com on 2017/3/22.
 */

public class SearchAttentionActivity extends SearchActivity {

    @Override
    protected void init() {
        String groupId = getIntent().getStringExtra("groupId");
        if(groupId != null){
            itemNames = new String[]{"产品", "公司", "人物", "关键字"};
            types = new int[]{8, 3, 4, 18};
        } else {
            itemNames = new String[]{"产品", "公司", "人物"};
            types = new int[]{8, 3, 4};
        }
        recycleView.setVisibility(View.GONE);
        super.init();
        searchEdit.setHint("请输入产品名、公司名、姓名");
//        ClickableTabLayout tabLayout = new ClickableTabLayout(this);
//        tabLayout.setLayoutParams(new LinearLayoutCompat.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
//                (int) getResources().getDimension(R.dimen.tab_layout_height)));
//        tabLayout.setBackgroundColor(getResources().getColor(R.color.gray_bg));
//        tabLayout.setSelectedTabIndicatorColor(getResources().getColor(R.color.theme_color));
//        tabLayout.setTabTextColors(getResources().getColor(R.color.font_black_think),
//                getResources().getColor(R.color.theme_color));
//        tabLayout.setTabMode(TabLayout.MODE_FIXED);
//        tabLayout.setSelectedTabIndicatorHeight((int) getResources().getDimension(R.dimen.tab_line_height));
//        tabLayout.setupWithViewPager(pager, true);
//        for(int i = 0, j = pager.getAdapter().getCount(); i < j; i++)
//            tabLayout.getTabAt(i).setText(itemNames[i]);
//        content.addView(tabLayout, 0);

        for(int i = 0, j = fragments.size(); i < j; i++)
            if(fragments.get(i) instanceof SearchAttentionFragment)
                ((SearchAttentionFragment)fragments.get(i)).setGroupId(groupId);
    }

    @Override
    protected int setSearchBgViewType(){
        return 348;
    }
}
